<?php
// +----------------------------------------------------------------------
// |目录管理控制器
// +----------------------------------------------------------------------


namespace app\admin\controller;

use app\BaseController;
use think\facade\View;
use think\facade\Cache;
use think\facade\Config;
use think\Request;
use app\admin\system\MenuService;
use think\response\Json;

class Menu extends BaseController
{
    //首页页面渲染
    public function index(){
      if(request()->isPost()){
          $param = request()->post();
          $data= MenuService::getlist($param);        
          success($data);
      }else{         
       
        return View::fetch();
      }      
    }
   
   //修改是否菜单
    public function update_ismenus(){
      if(request()->isPost()){
        $param = request()->post();
        $data= MenuService::update_ismenus($param);
        success($data);
      }
    }
    
    //执行添加修改
    public function create(){
        if(request()->isPost()){
            $param = request()->post();
            $data= MenuService::create($param);
            success($data);
        }else{
        }
    }

        
    //执行删除
    public function delete(){
    
          $param = request()->post();
          $data= MenuService::delete($param);
          success($data);
    
    }
    //获取所有目录列表
    public function list(){  
        $data= MenuService::list();
        success($data);       
    }
}